
#include <cstddef>
#include <cstdint>
#include <string>
#include "test_util.h"


void HexToData(const std::string & data, std::vector<uint8_t> & result_data)
{
    result_data.clear();
    for (std::size_t i = 0; i < data.size(); )
    {
        int b1 = data[i++];
        int b2 = data[i++];
        b1 = b1 >= 'a' ? (b1 - 'a') + 10 : (b1 - '0');
        b2 = b2 >= 'a' ? (b2 - 'a') + 10: (b2 - '0');

        uint8_t d = (b1 * 16) | (b2);

        result_data.push_back(d);
    }
}
